package composite;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName Department
 * @Description TODO
 * @Author leejiliang
 * @DateTime 2021/7/20 16:32
 * @Version 1.0
 */
public class Department {

	private Integer id;

	private String name;

	private Long parentId;

	private List<Department> subDepartments = new ArrayList<>();

	public Department(Integer id, String name) {
		this.id = id;
		this.name = name;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public List<Department> getSubDepartments() {
		return subDepartments;
	}

	public void setSubDepartments(List<Department> subDepartments) {
		this.subDepartments = subDepartments;
	}

	@Override
	public String toString() {
		return "Department{" +
				"id=" + id +
				", name='" + name + '\'' +
				'}';
	}
}
